<template>
    <div>
        <h1>权益信息录入</h1>
        <table class="table">
            <thead>
                <tr>
                    <td>权益名称</td>
                    <td>
                      <input type="text" v-model="data.name">
                    </td>
                </tr>
                <tr>
                    <td>权益说明</td>
                    <td>
                        <input type="text" v-model="data.shemo">
                    </td>
                </tr>
                <tr>
                    <td>权益状态</td>
                    <td>
                        <input type="checkbox" v-model="data.start">选中为启用，不选中为禁用
                    </td>
                </tr>
                <tr>
                    
                    <td colspan="2">
                        <input type="button" value="添加" @click="Add">
                    </td>
                </tr>
            </thead>
        </table>
    </div>
</template>
<script setup lang="ts">
import {ref}  from "vue"
import axios from "axios";
const data=ref({
    "qid": 0,
  "name": "",
  "shemo": "",
  "start": true
})
const Add=()=>{
    axios.post("https://localhost:7083/api/Query/AddQuery",data.value).then(res=>{
        if(res.data>0){
            alert('添加成功');
            location.href='/Showview';
        }
        else{
            alert('添加失败');
        }
    })
}
</script>
<style scoped></style>


